package com.slz3.business.module.goodsManagement.baseGoods.steward;

import com.slz3.business.frame.response.RR;
import com.slz3.business.frame.response.ResInfo;
import com.slz3.business.module.goodsManagement.baseGoods.domain.BaseGoods;
import com.slz3.business.module.goodsManagement.baseGoods.domain.BaseGoodsCondition;
import org.springframework.stereotype.Component;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

@Component
public class BaseGoodsResAtomic{

    public Mono<ServerResponse> add_$BaseGoodsUpdateLock(ServerRequest req, BaseGoods baseGoods) {
        return BaseGoodsResSafeValid.add(req, baseGoods) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                BaseGoodsResExecutor.add(req, baseGoods);
    }

    public Mono<ServerResponse> delete_$BaseGoodsUpdateLock(ServerRequest req, BaseGoodsCondition baseGoodsCondition) {
        return BaseGoodsResSafeValid.delete(req, baseGoodsCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                BaseGoodsResExecutor.delete(req);
    }

    public Mono<ServerResponse> modify_$BaseGoodsUpdateLock(ServerRequest req, BaseGoods baseGoods) {
        return BaseGoodsResSafeValid.modify(req, baseGoods) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                BaseGoodsResExecutor.modify(req, baseGoods);
    }

    public Mono<ServerResponse> info_$BaseGoodsUpdateLock(ServerRequest req) {
        return BaseGoodsResSafeValid.info(req) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                BaseGoodsResExecutor.info(req);
    }

    public Mono<ServerResponse> auditSubmit_$BaseGoodsUpdateLock(ServerRequest req, BaseGoodsCondition baseGoodsCondition) {
        return BaseGoodsResSafeValid.auditSubmit(req, baseGoodsCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                BaseGoodsResExecutor.auditSubmit(req);
    }

    public Mono<ServerResponse> audit_$BaseGoodsUpdateLock(ServerRequest req, BaseGoodsCondition baseGoodsCondition) {
        return BaseGoodsResSafeValid.audit(req, baseGoodsCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                BaseGoodsResExecutor.audit(req);
    }

    public Mono<ServerResponse> auditReject_$BaseGoodsUpdateLock(ServerRequest req, BaseGoodsCondition baseGoodsCondition) {
        return BaseGoodsResSafeValid.auditReject(req, baseGoodsCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                BaseGoodsResExecutor.auditReject(req);
    }


    public Mono<ServerResponse> usingEnable_$BaseGoodsUpdateLock(ServerRequest req, BaseGoodsCondition baseGoodsCondition) {
        return BaseGoodsResSafeValid.usingEnable(req, baseGoodsCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                BaseGoodsResExecutor.usingEnable(req);
    }

    public Mono<ServerResponse> usingDisable_$BaseGoodsUpdateLock(ServerRequest req, BaseGoodsCondition baseGoodsCondition) {
        return BaseGoodsResSafeValid.usingDisable(req, baseGoodsCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                BaseGoodsResExecutor.usingDisable(req);
    }
}
